home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 5⁄4⁄90 / 1217-DoSetCursor response-Apr90 < prev    next >
Encoding:
Text File  |  1990-05-04  |  2.3 KB  |  66 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  LOOMIS       to GUITTET1
  2.  
  3. Item forwarded  by  LOOMIS       to COWSAR1      PLUMMER1     REKIETA1
  4.  
  5. Item    2646240                         29-April-90        22:34PDT
  6.  
  7. From:   WILSON6                         Wilson, Dave-Personal Concepts,VCA
  8.  
  9. To:     MACAPP.TECH$                    MacApp Technical
  10.  
  11. cc:     S.FRIEDRICH                     Friedrich, Steve
  12.  
  13. Sub:    DoSetCursor response time
  14.  
  15. Can anyone suggest the best way to make DoSetCursor work?
  16.  
  17. As Rob Chandok mentioned recently, your application object will not check the
  18. cursor position often enough without your help.  What Rob recommended was
  19. setting TApplication.fIdleFreq := 5.  The problem is that this steals time from
  20. background tasks.
  21.  
  22. Here are my results so far with the small Bird sample from our book:
  23.  
  24. 1. Write the following method:
  25.  
  26. {$S ARes}
  27. FUNCTION TBirdView.DoSetCursor(localPoint: Point;
  28.                             cursorRgn: RgnHandle): BOOLEAN; OVERRIDE;
  29. VAR
  30.     qdExtent: Rect;
  31. BEGIN
  32.     SetCursor(GetCursor(crossCursor)^^);
  33.     GetQDExtent(qdExtent);
  34.     RectRgn(cursorRgn, qdExtent);
  35.     DoSetCursor := TRUE;
  36. END;
  37.  
  38. 2. Test the program under MultiFinder. As the mouse pointer is moved over the
  39. BirdView, the arrow changes to a cross cursor immediately at times, but
  40. sometimes the change is delayed for up to one second. I assume the application
  41. has gone to sleep for 60 ticks.
  42.  
  43. 3. Test the program with the MultiFinder "Timer" test program running in the
  44. background. This says that Timer gets about 97% of full performance, which is
  45. fine.  This also has the strange result that the cursor in the Bird sample
  46. program now switches quickly - no more 60 tick delay. Why?
  47.  
  48. 4. Recompile Bird, setting TBirdView.fIdleFreq to 6 ticks in TBirdView.IRes().
  49. Now the cursor always switches quickly, but Timer only gets about 92% time as a
  50. background task.
  51.  
  52. I would prefer to have the cursor always change quickly, and not steal time
  53. (even 5%) from background tasks. Is there a better way? I also assume that it
  54. is better to set the idle frequency for the view than for the application, if
  55. it is just for cursor tracking. Comments?
  56.  
  57. By the way, it seems messy to have to set fIdleFreq at all - it seems
  58. aesthetically more pleasing to just have to provide the DoSetCursor method, and
  59. have MacApp do the rest.
  60.  
  61. Thanks,
  62.  
  63. Dave
  64.  
  65.  
  66.